use std::option::Option;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Debug)]
pub struct GroupMessage {
    pub content: Option<String>,
    pub msg_type: i32,
    pub markdown: Option<String>,
    pub keyboard: Option<String>,
    pub media: Option<String>,
    pub ark: Option<String>,
    pub message_reference: Option<String>,
    pub event_id: Option<String>,
    pub msg_id: Option<String>,
    pub msg_seq: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct MessageResult {
    pub id: Option<String>,
    pub timestamp: Option<String>,
    pub audit_id: Option<String>,
    pub audit_tips: Option<String>
}

impl GroupMessage {
    pub fn new(content: Option<String>, event_id: Option<String>, msg_id: Option<String>) -> GroupMessage {
        GroupMessage {
            content,
            msg_type: 0,
            markdown: None,
            keyboard: None,
            media: None,
            ark: None,
            message_reference: None,
            event_id,
            msg_id,
            msg_seq: Option::from("1".to_string())
        }
    }
}